package com.itheima.Demo1hashset;

import java.util.HashSet;
import java.util.Set;

public class SetDemo2
{
    public static void main(String[] args) {
        Student s1 = new Student("小王", 18);
        Student s2 = new Student("小王", 18);
        Student s3 = new Student("小王", 18);
        Student s4 = new Student("小李", 20);
        Student s5 = new Student("小张", 19);
        Set<Student> set = new HashSet<>();
        set.add(s1);
        set.add(s2);
        set.add(s3);
        set.add(s4);
        System.out.println(set);
    }
}
